package com.ziven.common.widget.window;

import android.content.Context;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.ziven.easygo.design.mvp.AbstractOneData;
import com.ziven.easygo.design.mvp.OneModel;
import com.ziven.easygo.ui.AbstractOneDataFragment;

import java.util.Map;

/**
 * @author Ziven
 */
public abstract class SimpleFragment extends AbstractOneDataFragment {

    @NonNull
    @Override
    protected Class<? extends OneModel> obtainOneModelClass() {
        return SimpleModel.class;
    }

    @Override
    protected void destroyView() {

    }

    @Override
    public void layoutOneData(@NonNull AbstractOneData data) {

    }

    protected void obtainItemData(@NonNull SimpleModel model,
                                  @Nullable Context context,
                                  @Nullable Map<Object, Object> params) {

    }

    public class SimpleModel extends OneModel {
        @Override
        protected void obtainOneData(@Nullable Context c, @Nullable Map<Object, Object> params) {
            obtainItemData(this, c, params);
        }

        @Override
        public void obtainedOneData(@NonNull AbstractOneData data) {
            super.obtainedOneData(data);
        }
    }
}
